﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace DiscoveryLogic.UI.Layouts.Controls
{
    public partial class InvestmentStyleButton : UserControl
    {
        #region Private Variables

            private readonly string styleName;
            private bool toggled = false;

        #endregion

        #region Constructors

            public InvestmentStyleButton(string styleName)
            {
                // Required to initialize variables
                InitializeComponent();

                this.styleName = styleName;

                InvStyleNameLabel.Text = styleName;

                if (styleName.Length > 14)
                {
                    ButtonFrameScale.ScaleX = 1.25;
                }
            }

        #endregion

        #region Public Methods

            public string GetStyleName()
            {
                return styleName;
            }

        #endregion

        #region Public Properties

            public bool ToggleStatus
            {
                get { return toggled; }
                set 
                { 
                    toggled = value;
                    ToggleButton(toggled);
                }
            }

        #endregion

        #region Helper Methods

            private void ToggleButton(bool toggleStatus)
            {
                toggled = toggleStatus;

                if (toggled)
                {
                    invButtonGs1.SetValue(GradientStop.ColorProperty, "#FFFFDF80");
                    invButtonGs2.SetValue(GradientStop.ColorProperty, "#FFFFECB3");
                }
                else
                {
                    invButtonGs1.SetValue(GradientStop.ColorProperty, "#FF94C2E3");
                    invButtonGs2.SetValue(GradientStop.ColorProperty, "#FFA7DAFF");
                }
            }

        #endregion

    }
}
